<?php

namespace app\api\model;

class Banner extends BaseModel
{
	protected $hidden = ['create_time', 'name', 'from'];

//	public function items()
//	{
//		return $this->hasMany('BannerItem','banner_id','id');
//	}

    protected function base($query)
    {
        $query->order('create_time desc');
    }

    public function getImgAttr($value,$data)
	{
		return $this->prefixImgUrl($value,$data);
	}

	public static function getAllBanner()
	{
		$banner = self::select();

		return $banner;
	}
}